import 'package:kasax_demos2/entry/entrys.dart';
import 'package:kasax_demos2/repository/respository.dart';

/// 数据提供者
class DataProvider {
  static final DataProvider _instance = DataProvider._internal();

  factory DataProvider() => _instance;

  static DataProvider getInstance() => _instance;

  DataProvider._internal();

  Future<List<Posts>> fetchAllPosts() {
    var postsList = RemoteRepository.getInstance().fetchPostsList();
    return postsList;
  }

  Future<List<Posts>> fetchAllPostsWithDio() {
    var postsList = RemoteRepository.getInstance().fetchPostsListWithDio();
    return postsList;
  }
}
